package com.cleaningcloud.cld.mapper;

import java.util.List;
import com.cleaningcloud.cld.domain.CldTrainReceive;
import com.cleaningcloud.cld.domain.dto.CldTrainReceiveDto;
import com.cleaningcloud.cld.domain.vo.CldTrainReceiveVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 受训人信息Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-10-26
 */
public interface CldTrainReceiveMapper 
{
    /**
     * 查询受训人信息
     * 
     * @param trainReceiveId 受训人信息主键
     * @return 受训人信息
     */
    CldTrainReceiveVo selectCldTrainReceiveByTrainReceiveId(Long trainReceiveId);

    /**
     * 查询受训人信息列表
     * 
     * @param cldTrainReceive 受训人信息
     * @return 受训人信息集合
     */
    List<CldTrainReceiveVo> selectCldTrainReceiveList(CldTrainReceiveDto cldTrainReceive);

    /**
     * 新增受训人信息
     * 
     * @param cldTrainReceive 受训人信息
     * @return 结果
     */
    int insertCldTrainReceive(CldTrainReceive cldTrainReceive);

    /**
     * 修改受训人信息
     * 
     * @param cldTrainReceive 受训人信息
     * @return 结果
     */
    int updateCldTrainReceive(CldTrainReceive cldTrainReceive);

    /**
     * 删除受训人信息
     * 
     * @param trainReceiveId 受训人信息主键
     * @return 结果
     */
    int deleteCldTrainReceiveByTrainReceiveId(Long trainReceiveId);

    /**
     * 批量删除受训人信息
     * 
     * @param trainReceiveIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteCldTrainReceiveByTrainReceiveIds(Long[] trainReceiveIds);


    /**
     * 根据培训计划查询受训人列表
     * @param trainPlanId
     * @return
     */
    List<CldTrainReceiveVo> selectCldTrainReceiveListByPlanId(Long trainPlanId);


    /**
     * 根据培训讲师id查询受训人列表
     * @param trainIecturerId
     * @return
     */
    List<CldTrainReceiveVo> selectCldTrainReceiveListByIecturerId(Long trainIecturerId);



    /**
     * 根据培训计划id删除
     * @param trainPlanId
     */
    @Delete("delete from cld_train_receive where train_plan_id = #{trainPlanId}")
    void deleteCldTrainReceiveByPlanId(Long trainPlanId);


    /**
     * 批量新增
     * @param list
     */
    void batchCldTrainReceive(@Param("list") List<CldTrainReceive> list);
}
